package com.example.take_out_admin.controller;

import com.example.take_out_admin.common.Result;
import com.example.take_out_admin.entity.Employee;
import com.example.take_out_admin.exception.ResponseEnum;
import com.example.take_out_admin.service.EmployeeService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 员工信息 前端控制器
 * </p>
 *
 * @author wuyunbin
 * @since 2024-06-27
 */
@RestController
@RequestMapping("/employee")
public class EmployeeController {
    @Autowired
    private EmployeeService employeeService;

    @PostMapping("login")
    public Result<String> login(@RequestBody  Employee employee){
        String token = employeeService.login(employee);
        return Result.success(ResponseEnum.SUCCESS,token);
    }
    //?

}
